<?php
$phieuDatHang=$this->phieuDatHang;
$count=count($phieuDatHang) ;
?>

<?php
if($count>0){?>
<table border="1">
<tr>
<td>Mã Phiếu Hàng</td>
<td>Giá trị</td>
<td>Ngày Tạo</td>
<td>Trạng thái (Xử lý hay chưa)</td>
<td>Chi Tiết</td>
</tr>
	<?php foreach ($phieuDatHang as $ph):
	$ph instanceof Application_Model_bean_PhieuDatHang;
		$maPhieuHang=$ph->getMaPhieuDatHang();
		$giaTri=$ph->getGiaTri();
		$ngayTao=$ph->getNgayTao();
		$trangThai=$ph->getTrangThai();
$tr='Chưa Xử Lý';
if($trangThai==1){
	 $tr='Đã xử Lý';
}
?>

<tr>
<td> <?php echo $maPhieuHang; ?></td>
<td> <?php echo $giaTri; ?> </td>
<td>  <?php echo $ngayTao; ?> </td>
<td align="center">  <?php echo $tr; ?> </td>
	<td><form action="<?php echo $this->url(array('action'=>'chitietphieudathang')); ?>" method="post">
	<input type="submit" value="Xem Chi Tiet"></input>
	<input type="hidden" name="idPhieuDatHang" value="<?php echo $maPhieuHang; ?>">
	</form>
	</td>
	</tr>
<?php 
	endforeach;
}
?>
</table>
